package com.wcs.exam.common.enums;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum ExamTypeEnum {

    /**
     * 模拟考试
     */
    MOCK(1, "模拟考试"),

    /**
     * 正式考试
     */
    EXAMINATION(2, "正式考试");

    /**
     * 编码
     */
    private final Integer code;

    /**
     * 描述
     */
    private final String desc;


    public static ExamTypeEnum getByCode(Integer code) {
        for (ExamTypeEnum type : ExamTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
